package com.fmc.passport.util;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {

	public static Date getDateByString(String startDateString, String format)
			throws Exception {
		DateFormat df = new SimpleDateFormat(format);
		Date startDate = null;
		startDate = df.parse(startDateString);
		return startDate;
	}

	public static String getStringByDate(Date d, String format)
			throws Exception {
		DateFormat df = new SimpleDateFormat(format);
		String strReturn = null;
		strReturn = df.format(d);
		return strReturn;
	}

}
